<template>
	<view class="j-yongJinList">
		<view class="item" v-for="(item, index) in list" :key="index">
			<view class="info-1">
				<text>
					<text>订单号：</text>
					{{ item.orderId }}
				</text>
				<block v-if="xfd">
					<text style="color: #333" v-if="item.type == 1">
						{{ setTXT(item.status) }}
					</text>
				</block>
			</view>
			<view class="cus-line"></view>
			<view class="info-2">
				<text>{{ item.remark }}</text>
				<text v-if="xfd">{{ item.jifen }}</text>
				<text v-else-if="jf">{{ item.jifen }}</text>
				<text v-else-if="gf">{{ gfsettype(item.type) }}{{ item.money }}</text>
				<text v-else :style="[gfsettypes(item.type)]">{{ gfsettype(item.type) }}￥{{ item.money }}</text>
			</view>
			<view class="info-3">
				<text>{{ item.dtTime }}</text>
				<text v-if="gf">
					<text>总额：</text>
					{{ item.yue }}股
				</text>
				<text v-else>
					<block v-if="gfsettype(item.type) != '待入账'">
						<text>余额：</text>
						￥{{ item.yue }}
					</block>
				</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'j-yongJinList',
	props: {
		list: {
			type: Array | Number,
			default: () => {
				return [];
			}
		},
		jf: {
			type: Boolean,
			default: false
		},
		xfd: {
			type: Boolean,
			default: false
		},
		gf: {
			type: Boolean,
			default: false
		}
	},
	computed: {
		setTXT() {
			return (data) => {
				let num = Number(data);
				// status  0 待入账   1 已入账
				switch (num) {
					case 0:
						return '待入账';
						break;
					case 1:
						return '已入账';
						break;
					default:
						return '';
						break;
				}
			};
		},

		gfsettypes() {
			return (data) => {
				let num = Number(data);
				switch (num) {
					case 0:
						return {};
						break;
					case 3:
						return {};
						break;
					default:
						return { color: '#222222' };
						break;
				}
			};
		},
		gfsettype() {
			return (data) => {
				let num = Number(data);
				switch (num) {
					case 0:
						return `+`;
						break;
					case 3:
						return `-`;
						break;
					default:
						return `待入账`;
						break;
				}
			};
		},
		setType() {
			return (data) => {
				let num = Number(data);
				switch (num) {
					case 1:
						return `+`;
						break;
					case 2:
						return `-`;
						break;
					default:
						return ``;
						break;
				}
			};
		}
	},
	data() {
		return {};
	}
};
</script>

<style lang="less" scoped>
.j-yongJinList {
	.item + .item {
		margin-top: 16rpx;
	}
	.item {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		min-height: 196rpx;
		padding: 24rpx;
		background: #ffffff;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		.cus-line {
			border-bottom: 1rpx solid #f2f2f2;
		}
		.info-1 {
			.flex-between();
			font-size: 24rpx;
			padding-bottom: 12rpx;
			margin-bottom: 12rpx;
			& > text:nth-of-type(1) {
				color: #666666;
				text {
					color: #000000;
				}
			}
			text:nth-of-type(2) {
				font-size: 24rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #d10020;
			}
		}
		.info-2 {
			.flex-between();
			text:nth-of-type(1) {
				font-size: 28rpx;
				font-weight: bold;
				color: #222222;
			}
			text:nth-of-type(2) {
				font-size: 32rpx;
				color: #ff0000;
			}
		}
		.info-3 {
			.flex-between();
			& > text:nth-of-type(1) {
				font-size: 24rpx;
				color: #666666;
			}
			& > text:nth-of-type(2) {
				font-size: 28rpx;
				color: #000000;
				text {
					font-size: 24rpx;
				}
			}
		}
	}
}
</style>
